package com.ruoyi.recommend.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.recommend.mapper.NavigateMapper;
import com.ruoyi.recommend.domain.Navigate;
import com.ruoyi.recommend.service.INavigateService;

/**
 * 导航栏Service业务层处理
 *
 * @author wwh
 * @date 2023-07-23
 */
@Service
public class NavigateServiceImpl implements INavigateService
{
    @Autowired
    private NavigateMapper navigateMapper;

    /**
     * 查询导航栏
     *
     * @param id 导航栏主键
     * @return 导航栏
     */
    @Override
    public Navigate selectNavigateById(Integer id)
    {
        return navigateMapper.selectNavigateById(id);
    }

    /**
     * 查询导航栏列表
     *
     * @param navigate 导航栏
     * @return 导航栏
     */
    @Override
    public List<Navigate> selectNavigateList(Navigate navigate)
    {
        return navigateMapper.selectNavigateList(navigate);
    }

    /**
     * 新增导航栏
     *
     * @param navigate 导航栏
     * @return 结果
     */
    @Override
    public int insertNavigate(Navigate navigate)
    {
        navigate.setCreateTime(DateUtils.getNowDate());
        navigate.setUpdateTime(DateUtils.getNowDate());
        return navigateMapper.insertNavigate(navigate);
    }

    /**
     * 修改导航栏
     *
     * @param navigate 导航栏
     * @return 结果
     */
    @Override
    public int updateNavigate(Navigate navigate)
    {
        navigate.setUpdateTime(DateUtils.getNowDate());
        return navigateMapper.updateNavigate(navigate);
    }

    /**
     * 批量删除导航栏
     *
     * @param ids 需要删除的导航栏主键
     * @return 结果
     */
    @Override
    public int deleteNavigateByIds(Integer[] ids)
    {
        return navigateMapper.deleteNavigateByIds(ids);
    }

    /**
     * 删除导航栏信息
     *
     * @param id 导航栏主键
     * @return 结果
     */
    @Override
    public int deleteNavigateById(Integer id)
    {
        return navigateMapper.deleteNavigateById(id);
    }
}
